package com.vancouver.knows.business.tracker;

import com.pangu.task.IResultReceiver;
import com.pangu.task.OperateResult;
import com.vancouver.knows.business.BSharedPrefManager;
import com.vancouver.knows.business.BusinessModule;
import com.vancouver.knows.business.bean.PostPrivacySettingInfo;

/**
 * Created by Chris Li on 2016-07-26.
 */
public class PostPrivacySettingTracker extends ABInvokeTracker {

    public PostPrivacySettingTracker(BusinessModule module, IResultReceiver resultReceiver) {
        super(module, resultReceiver);
    }

    @Override
    public String TAG() {
        return PostPrivacySettingTracker.class.getSimpleName();
    }

    @Override
    public void handleResult(OperateResult result) {
        PostPrivacySettingInfo postPrivacySettingInfo = (PostPrivacySettingInfo) result.getResultData();
        if (postPrivacySettingInfo == null) {
            return;
        }

        BSharedPrefManager bSharedPrefManager = new BSharedPrefManager(imContext);
        bSharedPrefManager.saveListingsPrivacySetting(postPrivacySettingInfo.getWatchListPublic());
    }
}
